#ifndef SINGLEMAINVIEW_H
#define SINGLEMAINVIEW_H

#include <QWidget>
#include <QModelIndex>

class QListView;
class QStandardItemModel;
class QStringListModel;
class QListWidget;
class SimpleUtil;
class shellmanager;
class FileReverseThread;
class RWManager;

class SingleMainView : public QWidget
{
    Q_OBJECT
public:
    explicit SingleMainView(QWidget *parent = nullptr);

signals:
    void sendRootFilePath(QString path);///发送仓库本地目录
    void sendWorkFilePath(QString path);///发送工作目录

public slots:
    void listClick(QModelIndex index);
    void reveiveRootFilePath(QString file);///接受仓库目录信息
    void reveiveWorkFilePath(QString file);///接受工作目录信息

private:
    void initMainView();
    void initRootListView();

    void initSingnalSlot();                ///初始化信号槽函数

public:
    void setRootAndWorkDir(QString rootdir, QString workdir);       ///设置仓库和工作目录


private:
    QListWidget* _lviewroot;
    SimpleUtil* _sutil;
    QStandardItemModel *_itemmodelroot;
    int _rootcols;

    QString _rootdir;
    QString _workdir;

private:
    ///程序管理器
    shellmanager* _smanager;
    ///遍历文件夹类
    FileReverseThread* _reverseRootThread;
    FileReverseThread* _reverseWorkThread;

    ///文件比较工具
    RWManager*          _rwManager;
};

#endif // SINGLEMAINVIEW_H
